package com.metadata_system.common.db.mapper;

import com.metadata_system.common.db.entity.ProjectNode;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

public interface ProjectNodeMapper extends Mapper<ProjectNode> {
    @Select("select ifnull(sum(data_total),0) from md_project_node where project_id = #{projectId}")
    Integer getProjectDataTotal(Integer projectId);

    @Select("select ifnull(data_total,0) from md_project_node where metadata_id = #{metadataId} and metadata_node_name = #{metadataNodeName}")
    Integer getDataTotalByName(@Param("metadataId") Integer metadataId,@Param("metadataNodeName") String metadataNodeName);
}